package com.mi.rof.engineer.service;


import com.mi.rof.engineer.entity.RepairOrderEvents;
import com.mi.rof.engineer.entity.RepairOrderStates;
import com.mi.rof.engineer.entity.UploadInfoDTO;
import org.springframework.statemachine.StateMachine;
/**
 * @author zwq
 */
public interface RepairOrderStateService {
    /**
     * 工单加入消息队列的状态变更
     * @param orderId 工单id
     * @return  StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> toPendingConfirm(String orderId);
    /**
     * 上传故障信息的状态变更
     * @param uploadInfoDTO 上传故障信息DTO
     * @return StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> uploadFaultInfo(UploadInfoDTO uploadInfoDTO);

    /**
     * 预检的状态变更
     * @param isSkipApplyMaterials 是否跳过申请物料
     * @param orderId 工单id
     * @return StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> preview(boolean isSkipApplyMaterials, String orderId);

    /**
     * 物料发放的状态变更
     * @param applyStatus 是否申请成功
     * @param orderId 工单id
     * @return StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> materialDistribution(boolean applyStatus, String orderId);

    /**
     * 维修的状态变更
     * @param orderId 工单id
     * @return StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> repair(String orderId);

    /**
     * 审核的状态变更
     * @param orderId 工单id
     * @param reviewStatus 审核状态
     * @return StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> review(String orderId, boolean reviewStatus);

    /**
     * 支付的状态变更
     * @param orderId 工单id
     * @return StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> pay(String orderId);

    /**
     * 退货的状态变更
     * @param orderId 工单id
     * @return StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> returnDevice(String orderId);

    /**
     * 工单更新的状态变更
     * @param orderId 工单id
     * @return  StateMachine 状态机
     */
    StateMachine<RepairOrderStates, RepairOrderEvents> orderUpdate(String orderId);

}
